//
//  NSDate+DefinedDate.m
//  XJD
//
//  Created by Cen Zhou on 2018/1/9.
//  Copyright © 2018年 yupeidong. All rights reserved.
//

#import "NSDate+DefinedDate.h"

@implementation NSDate (DefinedDate)

+ (NSString *)getDateWithTimeInterval:(NSString *)timeInerval type:(NSString *)type{
    NSTimeInterval time = [timeInerval doubleValue]/1000;//因为时差问题要加8小时 == 28800 sec
    NSDate *detaildate=[NSDate dateWithTimeIntervalSince1970:time];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    //设定时间格式,这里可以设置成自己需要的格式
    [dateFormatter setDateFormat:type];
    
    NSString *currentDateStr = [dateFormatter stringFromDate: detaildate];
    return currentDateStr;
}
@end
